package com.afkt.lock.slice;

import com.afkt.lock.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Button;
import ohos.agp.components.Component;
import ohos.agp.window.dialog.ToastDialog;

public class PushLockScreenAbilitySlice extends AbilitySlice {
    private Button button1;
    private Button button2;
    private Button button3;
    private Button button4;

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_push_lock_screen); // 加载XML布局

        button1 = (Button) findComponentById(ResourceTable.Id_button_01);
        if (button1 != null) {
            button1.setClickedListener(new Component.ClickedListener() {
                @Override
                public void onClick(Component component) {
                    new ToastDialog(getContext()).setText("暂不支持").show();
                }
            });
        }
        button2 = (Button) findComponentById(ResourceTable.Id_button_02);
        super.setWakeUpScreen(true);
        button2.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                new ToastDialog(getContext()).setText("暂不支持").show();
            }
        });

        button3 = (Button) findComponentById(ResourceTable.Id_button_03);
        super.setWakeUpScreen(true);
        button3.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                new ToastDialog(getContext()).setText("暂不支持").show();
            }
        });

        button4 = (Button) findComponentById(ResourceTable.Id_button_04);
        super.setWakeUpScreen(true);
        button4.setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                new ToastDialog(getContext()).setText("暂不支持").show();

            }
        });

    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
